 import React from "react"
 import {getMov,Mov, ShuJu} from "./api/index"
 import {withRouter} from "react-router-dom"
 import "./style/index.css"

 class Move extends React.Component{
     constructor(){
         super()
         this.state={
             photo:[]
         }
     }
     
     componentDidMount(){
         let _this= this
         getMov().then(res=>{
            //  console.log(res);
            _this.setState({
                photo:res.data.result
            })
             
         })
     }
   Pai(){
    this.props.history.push("/move/paihang")
     }
     shuju(id){
        
        this.props.history.push({ pathname: "/move/xiangqing", state: { id } });
      } 
     render(){
         return(
                <div id="app">
                    <div className="in"> </div>
                    <ul className="zx_uul">
         {this.state.photo.map((item,id)=>
         (<li key={id}>
             <img src={item.picUrl} className="zx_aaa" onClick={this.shuju.bind(this,item.id)}></img>
             <h1>{item.name}</h1>
            <hr/>
             <p className="zx_p">{item.artistName}</p>
            </li>))}
                    </ul>
                    <div>
                        <h1 onClick={this.Pai.bind(this)} className="zx_jc">排行榜</h1>
                    </div>
                    <div>
                        <h1 className="zx_jc">更多精彩MV<button className="zx_fenlei">分类</button></h1>

                    </div>
                </div>
         )
    }
 }
 export default Move